package com.yiwu.web.controller;

import com.yiwu.common.domain.entity.Categories;
import com.yiwu.common.exception.BaseResponse;
import com.yiwu.common.utils.ResultUtil;
import com.yiwu.web.service.CategoriesService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0
 * @description TODO
 * @date 2024/5/21 21:59
 */
@RestController
@RequestMapping("/categories")
public class CategoriesController {

    @Resource
    private CategoriesService categoriesService;

    @Operation(summary = "获取分类标签")
    @GetMapping("/all")
    public BaseResponse<List<Categories>> getCategories(HttpServletRequest request){
        List<Categories> result = categoriesService.getCategories();
        return ResultUtil.success(result);
    }
}
